/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package interfaz;
/**/
import VO.Datos;
import control.ControlReportes;
import control.obtenerMedida;

/**
 *
 * @author xsebastianx
 */
public class panelReporte extends javax.swing.JPanel {

    ControlReportes controlReporte = new ControlReportes();
    /**
     * Creates new form panelReporte
     */
    public panelReporte() {
        initComponents();
        temL.setText("");
        pluviosidadL.setText("");
        presionL.setText("");
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        tituloL = new javax.swing.JLabel();
        mediaB = new javax.swing.JRadioButton();
        medianaB = new javax.swing.JRadioButton();
        modaB = new javax.swing.JRadioButton();
        varianzaB = new javax.swing.JRadioButton();
        desviacionB = new javax.swing.JRadioButton();
        ranintB = new javax.swing.JRadioButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        temL = new javax.swing.JLabel();
        presionL = new javax.swing.JLabel();
        pluviosidadL = new javax.swing.JLabel();

        tituloL.setText("Escoja la opcion que desea visalizar:");

        buttonGroup1.add(mediaB);
        mediaB.setText("Media");
        mediaB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                mediaClick(evt);
            }
        });

        buttonGroup1.add(medianaB);
        medianaB.setText("Mediana");
        medianaB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                medianaClick(evt);
            }
        });

        buttonGroup1.add(modaB);
        modaB.setText("Moda");
        modaB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modaClick(evt);
            }
        });

        buttonGroup1.add(varianzaB);
        varianzaB.setText("Varianza");
        varianzaB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                varianzaClick(evt);
            }
        });

        buttonGroup1.add(desviacionB);
        desviacionB.setText("Desviacion");
        desviacionB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                desviacionClick(evt);
            }
        });

        buttonGroup1.add(ranintB);
        ranintB.setText("Rango intercuartilico");
        ranintB.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ranintClick(evt);
            }
        });

        jLabel1.setText("Temperatura :");

        jLabel2.setText("Presion Atmosferica:");

        jLabel3.setText("Pluviosidad:");

        temL.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        presionL.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        pluviosidadL.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(mediaB)
                                    .addComponent(varianzaB))
                                .addGap(63, 63, 63)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(desviacionB)
                                    .addComponent(medianaB))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                    .addComponent(modaB)
                                    .addComponent(ranintB)))
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addGap(55, 312, Short.MAX_VALUE)))
                        .addContainerGap())
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel1)
                            .addComponent(jLabel3))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(pluviosidadL, javax.swing.GroupLayout.DEFAULT_SIZE, 251, Short.MAX_VALUE)
                            .addComponent(presionL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(temL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(20, 20, 20))))
            .addGroup(layout.createSequentialGroup()
                .addGap(116, 116, 116)
                .addComponent(tituloL)
                .addGap(0, 0, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(tituloL)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(mediaB)
                    .addComponent(medianaB)
                    .addComponent(modaB))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(varianzaB)
                    .addComponent(desviacionB)
                    .addComponent(ranintB))
                .addGap(53, 53, 53)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel1)
                    .addComponent(temL, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE)
                    .addComponent(presionL, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabel3)
                    .addComponent(pluviosidadL, javax.swing.GroupLayout.DEFAULT_SIZE, 22, Short.MAX_VALUE))
                .addContainerGap(115, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void mediaClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mediaClick
        // TODO add your handling code here:
        double[] medias = controlReporte.getMedia(Datos.getContenido());
        pluviosidadL.setText(String.valueOf(medias[0])+" Lts/diario");
        presionL.setText(String.valueOf(medias[1])+" atm");
        temL.setText(String.valueOf(medias[2])+" ºK");
    }//GEN-LAST:event_mediaClick

    private void medianaClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_medianaClick
        // TODO add your handling code here:
        double[] medianas = controlReporte.getMediana(Datos.getContenido());
        pluviosidadL.setText(String.valueOf(medianas[0])+" Lts/diario");
        presionL.setText(String.valueOf(medianas[1])+" atm");
        temL.setText(String.valueOf(medianas[2])+" ºK");
        
    }//GEN-LAST:event_medianaClick

    private void modaClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modaClick
        // TODO add your handling code here:
        double modas[] = controlReporte.getModa(Datos.getContenido());
        temL.setText(String.valueOf(modas[0])+" ºK");
        pluviosidadL.setText(String.valueOf(modas[1])+" Lts/diario");
        presionL.setText(String.valueOf(modas[2])+" atm");
        
    }//GEN-LAST:event_modaClick

    private void varianzaClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_varianzaClick
        // TODO add your handling code here:
        double[] varianzas = controlReporte.getVarianza(Datos.getContenido());
        pluviosidadL.setText(String.valueOf(varianzas[0])+" Lts/diario^2");
        presionL.setText(String.valueOf(varianzas[1])+" atm^2");
        temL.setText(String.valueOf(varianzas[2])+" ºK^2");
    }//GEN-LAST:event_varianzaClick

    private void desviacionClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_desviacionClick
        // TODO add your handling code here:
        double[] desviaciones=controlReporte.getDesviacion(Datos.getContenido());
        pluviosidadL.setText(String.valueOf(desviaciones[0])+" Lts/diario");
        presionL.setText(String.valueOf(desviaciones[1])+" atm");
        temL.setText(String.valueOf(desviaciones[2])+" ºK");
    }//GEN-LAST:event_desviacionClick

    private void ranintClick(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_ranintClick
        // TODO add your handling code here:
        String[] rangos=controlReporte.getRango(Datos.getContenido());
        pluviosidadL.setText(rangos[0]+" Lts/diario");
        presionL.setText(rangos[1]+" atm");
        temL.setText(rangos[2]+" °K");
    }//GEN-LAST:event_ranintClick

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JRadioButton desviacionB;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JRadioButton mediaB;
    private javax.swing.JRadioButton medianaB;
    private javax.swing.JRadioButton modaB;
    private javax.swing.JLabel pluviosidadL;
    private javax.swing.JLabel presionL;
    private javax.swing.JRadioButton ranintB;
    private javax.swing.JLabel temL;
    private javax.swing.JLabel tituloL;
    private javax.swing.JRadioButton varianzaB;
    // End of variables declaration//GEN-END:variables
}
